Skip to content

fix: harden Rust playground validation limits - #1026

Open
emirykl wants to merge 1 commit into
StellarDevHub:mainfrom
emirykl:drips/issue-922-backend-harden-rust-validation-with-bounded-inpu
Open

fix: harden Rust playground validation limits#1026
emirykl wants to merge 1 commit into
StellarDevHub:mainfrom
emirykl:drips/issue-922-backend-harden-rust-validation-with-bounded-inpu

Conversation

@emirykl

@emirykl emirykl commented Jul 30, 2026

Copy link
Copy Markdown

Summary

  • enforce a 64 KiB UTF-8 source limit and return structured HTTP 413 responses
  • bound validation to 100 ms and 100 diagnostics with actionable status and diagnostic codes
  • preserve normal validation behavior while preventing internal exception details from leaking
  • add focused service and API tests for normal code and limit failures

Test evidence

  • npm test -- --no-watchman --runTestsByPath tests/playground.validation.test.ts — passed, 9/9
  • strict isolated TypeScript check for the changed service and route — passed
  • git diff --check — passed
  • full backend Jest run: 28 suites passed; 14 unrelated baseline suites failed due existing queue declaration, Redis, SEO, and environment-test issues
  • full tsc --noEmit: existing unrelated Redis, webhook, storage, and notification errors remain

Fixes #922

Verification

  • PASS: Focused Jest suite — 9/9 tests
  • PASS: Strict TypeScript check for changed service and route
  • PASS: git diff --check
  • BASELINE: Full backend Jest — 28 suites passed, 14 unrelated suites failed
  • BASELINE: Full TypeScript check has existing unrelated Redis, webhook, storage, and notification errors

Diagnostics

Recovered command failures: /bin/zsh -lc 'npm test -- --no-watchman --runTestsByPath tests/playground.validation.test.ts' (127), /bin/zsh -lc 'npm ci --ignore-scripts' (255), /bin/zsh -lc 'npm_config_cache=/private/tmp/web3-student-lab-npm-cache npm ci --ignore-scripts' (1), /bin/zsh -lc "rg -c 'cdn\\.npmmirror\\.com' package-lock.json && rg -n 'cdn\\.npmmirror\\.com' package-lock.json | head -n 20" (1), /bin/zsh -lc 'npx tsc --noEmit' (2), /bin/zsh -lc 'npx prisma generate --schema=prisma/schema.prisma' (1), /bin/zsh -lc 'npx tsc --noEmit' (2), /bin/zsh -lc 'npm test -- --no-watchman' (1)

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

@emirykl is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@emirykl Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] Harden Rust validation with bounded input and actionable diagnostics

1 participant